package com.cty.B_AllocationAndCollection.B_PretenureSizeThreshold;

/**
 * @Auther: cty
 * @Date: 2020/6/29 22:04
 * @Description: 大对象直接进入老年代
 * @VM Args: -XX:+PrintGCDetails -Xms20m -Xmx20m -Xmn10m -XX:SurvivorRatio=8 -XX:PretenureSizeThreshold=3145728
 * @version: 1.0
 */
public class PretenureSizeThreshold {

    private static final int _1MB = 1024 * 1024;

    public static void testPretenureSizeThreshold(){
        byte[] allocation = new byte[4 * _1MB];
    }

    public static void main(String[] args) {
        testPretenureSizeThreshold();
    }  // end main()
}  // end class

/**
 * Heap
 *  def new generation   total 9216K, used 1370K [0x33a00000, 0x34400000, 0x34400000)
 *   eden space 8192K,  16% used [0x33a00000, 0x33b56b40, 0x34200000)
 *   from space 1024K,   0% used [0x34200000, 0x34200000, 0x34300000)
 *   to   space 1024K,   0% used [0x34300000, 0x34300000, 0x34400000)
 *  tenured generation   total 10240K, used 4096K [0x34400000, 0x34e00000, 0x34e00000)
 *    the space 10240K,  40% used [0x34400000, 0x34800010, 0x34800200, 0x34e00000)
 *  compacting perm gen  total 12288K, used 234K [0x34e00000, 0x35a00000, 0x38e00000)
 *    the space 12288K,   1% used [0x34e00000, 0x34e3aa60, 0x34e3ac00, 0x35a00000)
 *     ro space 10240K,  44% used [0x38e00000, 0x3927aee0, 0x3927b000, 0x39800000)
 *     rw space 12288K,  52% used [0x39800000, 0x39e42e10, 0x39e43000, 0x3a400000)
 */
